<template>
  <el-form-item label="ID">
    <el-input v-model="selectedOptions.name" disabled />
  </el-form-item>
  <el-form-item label="name">
    <el-input v-model="selectedWidget.name" disabled />
  </el-form-item>
  <el-form-item label="类型">
    <el-select v-model="selectedOptions.type" placeholder="Select">
      <el-option
        v-for="item in typeOptions"
        :key="item.value"
        :label="item.label"
        :value="item.value"
      />
    </el-select>
  </el-form-item>
  <el-form-item label="link链接名称">
    <el-input v-model="selectedOptions.linkText" />
  </el-form-item>
  <el-form-item label="是否下划线">
    <el-switch v-model="selectedOptions.underline" />
  </el-form-item>
  <el-form-item label="是否禁用状态">
    <el-switch v-model="selectedOptions.disabled" />
  </el-form-item>
  <el-form-item label="原生href属性">
    <el-input v-model="selectedOptions.href" />
  </el-form-item>
  <el-form-item label="同原生target属性">
    <el-select v-model="selectedOptions.target" placeholder="Select">
      <el-option
        v-for="item in targetOptions"
        :key="item.value"
        :label="item.label"
        :value="item.value"
      />
    </el-select>
  </el-form-item>
  <el-form-item label="图标组件">
    <el-input v-model="selectedOptions.icon" />
  </el-form-item>
</template>

<script setup>
defineOptions({
  name: "linkAttribute",
  inheritAttrs: false,
});
let $props = defineProps({
  selectedWidget: {
    type: Object,
    required: true,
  },
  selectedOptions: {
    type: Object,
    required: true,
  },
});
let typeOptions = [
  {
    value: "primary",
    label: "primary",
  },
  {
    value: "success",
    label: "success",
  },
  {
    value: "warning",
    label: "warning",
  },
  {
    value: "danger",
    label: "danger",
  },
  {
    value: "info",
    label: "info",
  },
  {
    value: "default",
    label: "default",
  },
];
let targetOptions = [
  {
    value: "_blank",
    label: "_blank",
  },
  {
    value: "_parent",
    label: "_parent",
  },
  {
    value: "_self",
    label: "_self",
  },
  {
    value: "_top",
    label: "_top",
  },
];
</script>

<style lang="scss" scoped></style>
